package cn.net.xyan.easy.spring.core.utils;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * Created by xiashenpin on 16/1/17.
 */
public class JavaClassSerializer extends JsonSerializer<Class> {

    @Override
    public void serialize(Class value, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {
        gen.writeString(value.getCanonicalName());
    }
}
